package com.example.ly.myapplication;

import android.app.Service;
import android.content.Intent;
import android.os.IBinder;
import android.util.Log;

public class BindService extends Service {
    private int info =1000;
    public BindService() {
    }

    @Override
    public void onCreate() {
        Log.i("john","this is create");
        super.onCreate();
    }

    @Override
    public void onDestroy() {
        Log.i("john","this is destroy");
        super.onDestroy();
    }

    @Override
    public IBinder onBind(Intent intent) {
        Log.i("john","bind serviserve");
        //生成桩对象
        Spy spyStub = new Spy();
        //给桩对象赋值，并连接
        spyStub.setInfo(info);
        //返回桩对象
        return  spyStub;

    }
}
